<?php

if(!isset($_SESSION))session_start();
include_once('AbstractDao.php');

class ProfessorDao extends AbstractDao{
    public function __construct(){ 
		parent::__construct();
	}
	  
    
    public function __retornaProfessores(){ # Verifica email e senha
     try{
                $retorno = NULL;	
                 $this->__executeSQL("
                        select * from Professor
                           
                ");
                $i = 0;
                while($this->__returnLinesSQL() > $i){
                        $matricula = $this->__returnSpecificContentSQL($i, 'matriculaProfessor');
                        $nome = $this->__returnSpecificContentSQL($i,'nome');
                        echo '<option value="' . $matricula .'">' . $matricula .' - ' . $nome . "</option>";
                        $i++;
                }
                $this->__freeMemory();
                return $retorno;

        }catch(Exception $e){
                throw $e;
        }
    }
    
    public function __pesqProfessor($pmatricula){ # Verifica email e senha
     try{
               $retorno = NULL;	
                $this->__executeSQL("
                        select * from Professor 
                        where matriculaProfessor = '".$pmatricula."' 
                           
                ");
               
                 if($this->__returnLinesSQL() > 0){
                        $retorno[0] = $this->__returnSpecificContentSQL(0, "matricula");
                        
                }
                $this->__freeMemory();
                return $retorno;

        }catch(Exception $e){
                throw $e;
        }
    }
    
    
}


